package model

import (
	"github.com/jinzhu/gorm"
)

type SingleTaskModel struct {
	gorm.Model
	TaskId   string `json:"task_id" form:"task_id" gorm:"type:char(10);not null;unique"`
	Platform string `json:"platform" form:"platform" gorm:"type:varchar(10);not null"`
	Account  string `json:"account" form:"account" gorm:"type:varchar(20);not null"`
	State    int    `json:"state" gorm:"type:int"`
}

type VideoModel struct {
	gorm.Model
	Vid          string `json:"vId" gorm:"type:varchar(20);not null"`
	Url          string `json:"vUrl" gorm:"type:varchar(100);not null"`
	Platform     int    `json:"platform" gorm:"type:int;not null"`
	TaskId       string `json:"taskId" gorm:"type:char(10);not null"`
	Title        string `json:"vTitle" gorm:"type:varchar(100);not null"`
	Summary      string `json:"vSummary" gorm:"type:varchar(200)"`
	PublishTime  int64  `json:"vPublishTime" gorm:"type:bigint(13);not null"`
	CrawlTime    int64  `json:"vCrawlTime" gorm:"type:bigint(13);not null"`
	ViewCount    int    `json:"vViewCount" gorm:"type:int"`
	LikeCount    int    `json:"vLikeCount" gorm:"type:int"`
	CommentCount int    `json:"vCommentCount" gorm:"type:int"`
	HashTag      string `json:"vHashTag" gorm:"type:varchar(100)"`
	AuthorId     string `json:"authorId" gorm:"type:varchar(30);not null"`
}

type AuthorModel struct {
	gorm.Model
	AuthorId  string `json:"authorId" gorm:"type:varchar(30);not null"`
	Platform  int    `json:"platform" gorm:"type:int;not null"`
	NickName  string `json:"nickName" gorm:"type:varchar(30);not ull"`
	Introduce string `json:"introduce" gorm:"type:varchar(100)"`
	Following int    `json:"following" gorm:"type:int"` // 关注数
	Followed  int    `json:"followed" gorm:"type:int"`  // 粉丝数
	Works     int    `json:"works" gorm:"type:int"`     // 作品数
	Likes     int    `json:"likes" gorm:"type:int"`     // 点赞数
	Views     int    `json:"views" gorm:"type:int"`     // 播放量
}

type UrlRecord struct {
	Url string `json:"url" gorm:"type:varchar(50);not null"`
}

type UpdateUrlState struct {
	Id     uint   `json:"id"`
	TaskId string `json:"taskId"`
	State  int    `json:"state"`
}
